package com.zhiyou100.service.impl;

import com.zhiyou100.entity.Contract;
import com.zhiyou100.mapper.ContractMapper;
import com.zhiyou100.service.ContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 租凭合同实现类
 *
 * @author yang
 * @version 1.0.0
 * @date 2020-08-29 15:47
 */
@Service
public class ContractImpl implements ContractService {
    private ContractMapper contractMapper;

    @Autowired
    public void setContractMapper(ContractMapper contractMapper) {
        this.contractMapper = contractMapper;
    }

    @Override
    public List<Contract> listContract() {
        return contractMapper.listContract();
    }

    @Override
    public Contract selectOneByCid(Integer cid) {
        return contractMapper.selectOneByCid(cid);
    }

    @Override
    public void updateOneContract(Contract contract) {
        contractMapper.updateOneContract(contract);
    }

    @Override
    public void deleteOneByCid(Integer cid) {
        contractMapper.deleteOneByCid(cid);
    }

    @Override
    public void insertOne(Contract contract) {
        contractMapper.insertOne(contract);
    }
}
